package com.ymatou.query.trading.api.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.query.trading.api.parameter.GetOrderInfoBean;
import com.ymatou.query.trading.api.service.GetOrderInfoCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.utils.constant.ECode;

/**
 * 获取订单信息 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_GetOrderInfo {

	private static GetOrderInfoBean orderinfobean;
	private static GetOrderInfoCall orderinfocall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取订单信息");
	}

	@Before
	public void caseUp() {

		orderinfobean = new GetOrderInfoBean();
		orderinfocall = new GetOrderInfoCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(orderinfocall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetOrderInfo_001() {
		Logger.start(true,"获取订单信息成功");
		try {
			orderinfobean.setOrderId(105250026);
			// 发送请求
			orderinfocall.setData(orderinfobean);
			orderinfocall.callService();
			Logger.comment("orderinfocall send:" + orderinfocall.getEntityString());
			Logger.comment("orderinfocall response:" + orderinfocall.getReturnData());
			Logger.verifyEquals(ECode.SUCCESS, orderinfocall.getCode(), "验证Code");
			// Logger.verifyEquals(ErrorCode.SUCCESSMSG, orderinfocall.getMsg(),
			// "验证Msg");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}